import 'dart:math';

import 'package:aegis_flutter_sdk/aegis_flutter_sdk.dart';
import 'package:aegis_flutter_sdk/src/core.dart';

class FakeAegis extends Core {
  FakeAegis(Config config) : super(config);

  @override
  void setAid() {
    String aid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
        .replaceAllMapped(RegExp(r"[xy]"), (match) {
      int r = Random().nextInt(16);
      int v = match[0] == 'x' ? r : (r & 0x3) | 0x8;

      return v.toRadixString(16);
    });
    config.setAid(aid);
  }
}
